package itsm.isperp.framework.web.converter;

import itsm.isperp.framework.utils.DateUtils;

import java.io.IOException;
import java.util.Date;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

/**
 * 
 * 
 * @author lizx
 * @date 2013-5-14
 */
public class CustomDateJsonSerializer extends JsonSerializer<Date> {

	@Override
	public void serialize(Date date, JsonGenerator json,
			SerializerProvider provider) throws IOException,
			JsonProcessingException {

		json.writeString(DateUtils.formatDate(date));

	}
}
